#ifndef GLOBALS_H
#define GLOBALS_H

#include <d3d11.h>
#include <dxerr.h>
#include <string>
#include "..\Cameras\BaseCamera.h"

#if defined(DEBUG) | defined(_DEBUG)
	#ifndef HR
		#define HR(x)                                              \
		{                                                          \
		HRESULT hr = (x);                                      \
		if(FAILED(hr))                                         \
			{                                                      \
			DXTraceW(__FILE__, (DWORD)__LINE__, hr, DXGetErrorDescriptionW(hr), true); \
			}                                                      \
		}														
	#endif
#else
	#ifndef HR
		#define HR(x) (x)
	#endif
#endif 

#if defined(DEBUG) | defined(_DEBUG)
	#ifndef ERR
		#define ERR(x, errorString)	\
		{                                                          \
		HRESULT hr = (x);                                      \
		if(FAILED(hr))                                         \
			{                                                      \
			std::stringstream out;							\
			out << "Error - file: " << __FILE__ << " - line: " << (DWORD) __LINE__;	\
			MessageBox(0, ((std::string)errorString).c_str(), out.str().c_str(), 0);             \
			}                                                      \
		}
	#endif
#else
	#ifndef ERR
		#define ERR(x, errorString) (x)
	#endif
#endif


class Globals
{
public:
	static ID3D11Device* Device;
	static ID3D11DeviceContext* Context;
	static HWND Window;

	static bool SHOW_DEBUG;
	static bool SHOW_INFO;
	static bool SHOW_ERRORS;

	static bool MOUSE_ACQUIRED;
	static bool CORRECTLY_SETUP;

	static char* RES_PATH;
	static HINSTANCE AppInstance;
	static Cameras::BaseCamera* ActiveCamera;
};

#endif

